package com.macro.mall.portal.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.BmsGuidePoint;
import com.macro.mall.portal.dto.BmsGuidePointParam;
import com.macro.mall.portal.service.BmsGuidePointService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 导览点位ontroller
 * Created by macro on 2018/4/26.
 */
@Controller
@Api(tags = "BmsGuidePointController")
@Tag(name = "BmsGuidePointController", description = "导览点位管理")
@RequestMapping("/guidePointMp")
public class BmsGuidePointController {
    @Autowired
    private BmsGuidePointService bmsGuidePointService;
    @ApiOperation("分页查询导览点位")
    @RequestMapping(value = "/mpList", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<CommonPage<BmsGuidePoint>> getList(@RequestBody BmsGuidePointParam bmsGuidePointParam) {
        List<BmsGuidePoint> BmsGuidePointList = bmsGuidePointService.getList(bmsGuidePointParam);
        return CommonResult.success(CommonPage.restPage(BmsGuidePointList));
    }
//
    @ApiOperation("根据id获取导览点位信息")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<BmsGuidePoint> getItem(@PathVariable Long id) {
        BmsGuidePoint bmsGuidePoint = bmsGuidePointService.getDetail(id);
        return CommonResult.success(bmsGuidePoint);
    }
//
}
